package com.log6z.dashborad.enums;

import java.util.Objects;

public interface AppointmentUnloadEnum {

    /**
     * 叫号类型
     */
    enum CallType {
        HUMAN_CALL(1, "人工叫号"),
        SYSTEM_CALL(2, "程序自动叫号");

        private Integer value;
        private String label;

        CallType(Integer value, String label) {
            this.value = value;
            this.label = label;
        }

        public Integer getValue() {
            return value;
        }

        public String getLabel() {
            return label;
        }
    }

    /**
     * 流程状态：0已预约; 1已打卡; 2已叫号; 3已入场; 4待作业; 5作业完成(已过空磅); 6出场; 7作业异常; 8任务作废'
     */
    enum ProcessStatus {
        OK_APPOINTMENT(0, "已预约"),
        OK_CLOCK(1, "已打卡"),
        CALL_NUMBER(2, "已叫号"),
        IN_FACTORY_AREA(3, "已入场"),
        OPERATION(4, "待作业"),
        OK_OPERATION(5, "作业完成（已过空磅)"),
        OUT_FACTORY_AREA(6, "出场"),
        OPERATION_JOB(7, "作业异常"),
        INVALID_OPERATION(8, "任务作废");

        private Integer value;
        private String label;

        ProcessStatus(Integer value, String label) {
            this.value = value;
            this.label = label;
        }

        public Integer getValue() {
            return value;
        }

        public String getLabel() {
            return label;
        }

        public static ProcessStatus get(Integer val) {
            ProcessStatus[] values = ProcessStatus.values();
            for (ProcessStatus enu : values) {
                if (Objects.equals(val, enu.getValue())) {
                    return enu;
                }
            }
            return null;
        }
    }

    /**
     * 审核状态: 0待审核; 10待运输; 40任务完成; 50已驳回; 60已取消; 70已释放; 80任务异常; 90手动作废; 100空进空出
     */
    enum Status {
        WAIT_EXAMINE(0, "待审核"),
        WAIT_TRANSPORT(10, "待运输"),
        FINISH(40, "任务完成"),
        REJECT(50, "已驳回"),
        CANCEL(60, "已取消"),
        RELEASE(70, "已释放"),
        EXCEPTION(80, "任务异常"),
        INVALID(90, "手动作废"),
        EMPTY_IN_TEMPTY_OUT(100, "空进空出");

        private Integer value;
        private String label;

        Status(Integer value, String label) {
            this.value = value;
            this.label = label;
        }

        public Integer getValue() {
            return value;
        }

        public String getLabel() {
            return label;
        }

        public static ProcessStatus get(Integer val) {
            ProcessStatus[] values = ProcessStatus.values();
            for (ProcessStatus enu : values) {
                if (Objects.equals(val, enu.getValue())) {
                    return enu;
                }
            }
            return null;
        }
    }





}
